package com.xudm.cdg.entity;

/**
 *  @author zxw
 * 枚举了一些常用API操作码
 */
public enum ResultCode implements IErrorCode {
    SUCCESS(1000, "操作成功"),
    FAILED(500, "操作失败"),

    NOT_FOUND(404, "接口未找到"),
    UNAUTHORIZED(401, "暂未登录或token已经过期"),
    FORBIDDEN(403, "没有相关权限"),

    BAD_REQUEST(400, "BAD_REQUEST"),
    REQUEST_ENTITY_TOO_LARGE(413, "上传文件过大或请求报文过长"),

    SERVER_ERROR(500, "服务器内部错误"),

    UNSUPPORTED_MEDIA_TYPE(501, "服务器内部错误"),

    METHOD_NOT_ALLOWED(405, "请求方式错误");
    private final Integer code;
    private final String msg;

    private ResultCode(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
